/** allocate.d - Allocator implemention
  Written in the D programming language 1.0

Authors:	Wei Li <oldrev@gmail.com>
Copyright:	Copyright (C) 2007 by Wei Li.
License:	BSD

*/

module dotmars.base.allocation;

/* The model of allocators
template Allocator()
{
	void* allocate(size_t n); //size in bytes
	void deallocate(void* p);
}
*/

template DefaultGCAllocator()
{
    static void* allocate(size_t n)
    {
        return (new void[n]).ptr;
    }

    static void deallocate(void* ptr)
    {
        //beacuse we are using GC, so do nothing.
    }
}
